package com.zxcl.feign;

import com.zxcl.domain.Sku;
import com.zxcl.feign.sentinel.OrderProdFeignSentinel;
import com.zxcl.model.ChangeStock;
import com.zxcl.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 描述: []
 * 作者: zxcl
 */
@FeignClient(value = "product-service", fallback = OrderProdFeignSentinel.class)
public interface OrderProdFeign {

    /**
     * 根据skuIds拿SKU的信息
     * @param skuIds
     * @return
     */
    @GetMapping("prod/prod/getSkusByIds")
    Result<List<Sku>> getSkusByIds(@RequestParam("skuIds") List<Long> skuIds);


    /**
     * 修改库存
     * @param changeStock
     * @return
     */
    @PostMapping("prod/prod/changeStocks")
    Result<Boolean> changeStocks(@RequestBody ChangeStock changeStock);

}
